<?php

class Nuo_Html_Render_MultiInput
{
	public function render($ele)
	{
		$values = (array)$ele -> getValue();
		
		if(empty($values)){
			$values[] = '';
		}

		$xhtml = array();
		$name = $ele -> getName();
		$attr = $ele -> getAttribs();

		foreach ($values as $key => $value)
		{
			$attr['name'] = $name . '[]';
			$attr['value'] = $value;
			$xhtml[] = sprintf('<div><input %s /></div>', flat_html($attr));
		}
		return implode(PHP_EOL, $xhtml);
	}
}